Homework 8 - using an API

Author

Alex Welk

Published

November 19, 2023

This assignment is in two parts. The first is a set of exercises and the second is a reflection / essay style series of questions consolidating learning and encouraging a deeper understanding of APIs.

The exercises in this project reinforce basic API usage concepts using the “Rick and Morty” API. Each exercise builds upon the previous ones and introduces new concepts.

Be sure to review the references at the bottom of this document. These references pertain DIRECTLY to this assignment and just may provide you with the code that you need to successfully complete the project.

Background

The “Rick and Morty” API is a RESTful web service that provides information about the characters, locations, and episodes from the “Rick and Morty” animated television series. It’s designed to allow developers to query and retrieve data programmatically, which makes it an excellent tool for educational purposes, fan projects, or applications that require information from the show’s universe.

Here’s an overview of the main features of the API:

  • Characters: You can retrieve data about characters, including their names, species, images, location, and status (alive, dead, or unknown). This allows developers to use character data for creating applications or services that need detailed information about the show’s cast.

  • Locations: The API provides details about the various locations that characters in the show have visited, including planets, dimensions, and more. This can be used to create applications that provide a geographical context for the events in the series.

  • Episodes: Information about each episode is available through the API, including air dates, the episode’s name, and the characters that appear in it. This is useful for creating applications that track story arcs or character appearances.

  • Filters and Queries: The API supports filtering and search queries, which means developers can request lists of characters, locations, or episodes based on specific criteria (like all characters who are “Human” or locations in a particular dimension).

  • Pagination: To manage large datasets, the API uses pagination, so developers need to write code that can handle multiple requests if they want to retrieve all items in a category.

The “Rick and Morty” API is a fun and engaging way for fans and developers to interact with the show’s rich and detailed universe. Its straightforward design and comprehensive dataset make it an excellent choice for teaching API interaction concepts.

Exercises

The following exercises offer practice using an API. References are provided below. However, in this scaffold I’m NOT providing much sample code. See the references below for sample code.

TIP: I suggest that you start with the python API tutorial in the references. You’ll probably want to use the requests module. If you get a module not found error when you import it, then you’ll need to make sure that Poetry adds it to your environment using poetry add requests.

Exercise 1: Basic API Request

Objective: Retrieve and print the first 5 characters from the API.

Concepts: HTTP GET request, JSON response parsing.

# Use requests to perform a GET request to the API.
# Parse the JSON response to print the names of the first 5 characters.

response = requests.get("https://rickandmortyapi.com/api/character/1,2,3,4,5")
if response.status_code == 200:
    data = response.json()
    for x in range(5):
        name = data[x]['name']
        print(name)
else:
    print("Request failed with status code: ", response.status_code)
Rick Sanchez
Morty Smith
Summer Smith
Beth Smith
Jerry Smith

Exercise 2: Handling Pagination

Objective: Retrieve and print the names of all characters that appear on the first 3 pages of the API results.

Concepts: Looping over pages, query parameters.

# Use a loop to navigate through the first 3 pages.
# Collect and print the names of the characters from these pages.

base_url = "https://rickandmortyapi.com/api/character"
all_characters = []

for page in range(3):
    url = f"{base_url}/?page={page}"

    response = requests.get(url)
    if response.status_code == 200:
        characters_on_page = response.json()["results"]
        all_characters.extend(characters_on_page)
    else:
        print(f"Error fetching data from page {page}. Status code: {response.status_code}")

for character in all_characters:
    print(f"{character['name']}")
Rick Sanchez
Morty Smith
Summer Smith
Beth Smith
Jerry Smith
Abadango Cluster Princess
Abradolf Lincler
Adjudicator Rick
Agency Director
Alan Rails
Albert Einstein
Alexander
Alien Googah
Alien Morty
Alien Rick
Amish Cyborg
Annie
Antenna Morty
Antenna Rick
Ants in my Eyes Johnson
Rick Sanchez
Morty Smith
Summer Smith
Beth Smith
Jerry Smith
Abadango Cluster Princess
Abradolf Lincler
Adjudicator Rick
Agency Director
Alan Rails
Albert Einstein
Alexander
Alien Googah
Alien Morty
Alien Rick
Amish Cyborg
Annie
Antenna Morty
Antenna Rick
Ants in my Eyes Johnson
Aqua Morty
Aqua Rick
Arcade Alien
Armagheadon
Armothy
Arthricia
Artist Morty
Attila Starwar
Baby Legs
Baby Poopybutthole
Baby Wizard
Bearded Lady
Beebo
Benjamin
Bepisian
Beta-Seven
Beth Sanchez
Beth Smith
Beth Smith
Beth's Mytholog

Exercise 3: Query Parameters

Objective: Find and print all characters with the name “Rick”.

Concepts: Utilizing query parameters, conditional logic.

# Use query parameters to filter results by name.
# Check if the characters' names contain "Rick" and print them.
def get_ricks():
    api_url = "https://rickandmortyapi.com/api/character/?name=rick"

    try:
        response = requests.get(api_url)
        response.raise_for_status()  # Check for any errors in the HTTP request

        data = response.json()
        rick_characters = data.get("results", [])

        return rick_characters
    except requests.exceptions.RequestException as e:
        print(f"Error fetching data from the API: {e}")
        return None

if __name__ == "__main__":
    rick_characters = get_ricks()

    if rick_characters:
        print("Characters named 'Rick':")
        for character in rick_characters:
            print(character["name"])
    else:
        print("Failed to fetch data.")
Characters named 'Rick':
Rick Sanchez
Adjudicator Rick
Alien Rick
Antenna Rick
Aqua Rick
Black Rick
Bootleg Portal Chemist Rick
Commander Rick
Cool Rick
Cop Rick
Cowboy Rick
Cronenberg Rick
Cyclops Rick
Doofus Rick
Evil Rick
Garment District Rick
Insurance Rick
Investigator Rick
Juggling Rick
Maximums Rickimus

Exercise 4: Error Handling

Objective: Write a function that takes a character ID and prints the character’s information. It should handle cases where the character does not exist.

Concepts: Error handling, function definition.

# Define a function that accepts a character ID.
# Make a request to the API and handle any potential errors, like a 404.
import requests

def get_character_info(character_id):
    api_url = f"https://rickandmortyapi.com/api/character/{character_id}"

    try:
        response = requests.get(api_url)
        response.raise_for_status()  # Check for any errors in the HTTP request

        character_data = response.json()

        if "error" in character_data:
            print(f"Character with ID {character_id} not found.")
        else:
            print(f"Character Information for ID {character_id}:")
            print(f"Name: {character_data['name']}")
            print(f"Status: {character_data['status']}")
            print(f"Species: {character_data['species']}")
            # Add more fields as needed

    except requests.exceptions.RequestException as e:
        print(f"Error fetching data from the API: {e}")

if __name__ == "__main__":
    # Example usage with character ID 1
    ## character_id = input("Enter character ID: ")
    character_id = 1
    get_character_info(character_id)
Character Information for ID 1:
Name: Rick Sanchez
Status: Alive
Species: Human

Exercise 5: Data Manipulation

Objective: Retrieve all locations and their associated characters, and present this information in a dictionary with location names as keys and lists of character names as values.

Concepts: Data structuring, nested API calls.

# Retrieve all locations.
# For each location, make an API call to get the characters for that location.
# Store the results in a dictionary and print it.

import requests

def get_all_locations():
    api_url = "https://rickandmortyapi.com/api/location"

    try:
        response = requests.get(api_url)
        response.raise_for_status() 

        locations_data = response.json()
        locations = locations_data.get("results", [])

        return locations
    except requests.exceptions.RequestException as e:
        print(f"Error fetching data from the API: {e}")
        return None

def get_characters_in_location(location_url):
    try:
        response = requests.get(location_url)
        response.raise_for_status()

        location_data = response.json()
        characters = location_data.get("residents", [])

        return characters
    except requests.exceptions.RequestException as e:
        print(f"Error fetching data from the API: {e}")
        return None

def main():
    locations = get_all_locations()

    if locations:
        location_character_dict = {}

        for location in locations:
            location_name = location["name"]
            location_url = location["url"]

            characters_in_location = get_characters_in_location(location_url)

            if characters_in_location is not None:
                location_character_dict[location_name] = characters_in_location

        print("Characters in each location:")
        for location, characters in location_character_dict.items():
            print(f"\n{location}:")
            for character_url in characters:
                character_info = requests.get(character_url).json()
                print(f"  - {character_info['name']}")

if __name__ == "__main__":
    main()
Characters in each location:

Earth (C-137):
  - Beth Smith
  - Bill
  - Conroy
  - Cronenberg Rick
  - Cronenberg Morty
  - Davin
  - Eric McMan
  - Ethan
  - Evil Beth Clone
  - Evil Jerry Clone
  - Evil Summer Clone
  - Frank Palicky
  - Harold
  - Jacob
  - Jerry Smith
  - Jessica
  - Joyce Smith
  - Leonard Smith
  - MC Haps
  - Mr. Goldenfold
  - Principal Vagina
  - Ruben
  - Samantha
  - Summer Smith
  - Tammy Guetermann
  - Tom Randolph
  - Davin

Abadango:
  - Abadango Cluster Princess

Citadel of Ricks:
  - Adjudicator Rick
  - Alien Morty
  - Alien Rick
  - Antenna Morty
  - Aqua Morty
  - Aqua Rick
  - Artist Morty
  - Big Head Morty
  - Big Morty
  - Body Guard Morty
  - Black Rick
  - Blue Shirt Morty
  - Bootleg Portal Chemist Rick
  - Campaign Manager Morty
  - Commander Rick
  - Cool Rick
  - Cop Morty
  - Cop Rick
  - Cowboy Morty
  - Cowboy Rick
  - Cyclops Morty
  - Cyclops Rick
  - Dipper and Mabel Mortys
  - Evil Morty
  - Evil Rick
  - Fat Morty
  - Garment District Rick
  - Glasses Morty
  - Hammerhead Morty
  - Insurance Rick
  - Investigator Rick
  - Juggling Rick
  - Lawyer Morty
  - Lizard Morty
  - Long Sleeved Morty
  - Mega Fruit Farmer Rick
  - Morty Mart Manager Morty
  - Morty Rick
  - Mortytown Loco
  - Plumber Rick
  - Regional Manager Rick
  - Reverse Rick Outrage
  - Rick D. Sanchez III
  - Rick Guilt Rick
  - Rick Prime
  - Rick D-99
  - Rick D716
  - Rick D716-B
  - Rick D716-C
  - Rick J-22
  - Riq IV
  - Robot Morty
  - Robot Rick
  - Simple Rick
  - Slick Morty
  - Slow Rick
  - Solicitor Rick
  - Teacher Rick
  - Tortured Morty
  - Trunk Morty
  - Wall Crawling Rick
  - Yellow Shirt Rick
  - Bearded Morty
  - Communication's Responsible Rick
  - Teleportation's Responsible Rick
  - SEAL Team Rick
  - SEAL Team Rick
  - SEAL Team Rick
  - SEAL Team Rick
  - Baby Rick
  - Bartender Morty
  - Dancer Cowboy Morty
  - Dancer Morty
  - Flower Morty
  - Hairdresser Rick
  - Journalist Rick
  - Private Sector Rick
  - Purple Morty
  - Retired General Rick
  - Secret Service Rick
  - Steve Jobs Rick
  - Sheik Rick
  - Modern Rick
  - Tan Rick
  - Visor Rick
  - Colonial Rick
  - P-Coat Rick
  - Morty Smith
  - Rick Sanchez
  - 7+7 Years Old Morty
  - 26 Years Old Morty
  - 40 Years Old Morty
  - Andy
  - Baby Mouse Skin Morty
  - Metaphor for Capitalism
  - Stan Lee Rick
  - Re-Build-a-Morty Morty
  - Deformed Morty
  - Redhead Rick
  - Redhead Morty
  - Long Hair Rick

Worldender's lair:
  - Alan Rails
  - Crocubot
  - Logic
  - Million Ants
  - Supernova
  - Traflorkian
  - Vance Maximus
  - Worldender
  - Greebybobe

Anatomy Park:
  - Alexander
  - Annie
  - Tuberculosis
  - Gonorrhea
  - Hepatitis A
  - Hepatitis C
  - Bubonic Plague
  - E. Coli
  - Dr. Xenon Bloom
  - Poncho
  - Roger

Interdimensional Cable:
  - Ants in my Eyes Johnson
  - Attila Starwar
  - Baby Legs
  - Benjamin
  - Blamph
  - Blue Diplomat
  - Bobby Moynihan
  - Eyehole Man
  - Fleeb
  - Fulgora
  - Garmanarnar
  - Gazorpazorpfield
  - Glenn
  - Hole in the Wall Where the Men Can See it All
  - Jan-Michael Vincent
  - Jon
  - Little Dipper
  - Loggins
  - Man Painted Silver Who Makes Robot Noises
  - Michael Denny and the Denny Singers
  - Michael Jenkins
  - Michael McLick
  - Michael Thompson
  - Mrs. Sullivan
  - Octopus Man
  - Phillip Jacobs
  - Pichael Thompson
  - Piece of Toast
  - Randy Dicknose
  - Real Fake Doors Salesman
  - Regular Legs
  - Shlaammi
  - Shmlamantha Shmlicelli
  - Shmlangela Shmlobinson-Shmlower
  - Shmlona Shmlobinson
  - Shmlonathan Shmlower
  - Shmlony Shmlicelli
  - Stealy
  - Three Unknown Things
  - Tophat Jones
  - Trunk Man
  - Two Guys with Handlebar Mustaches
  - Unmuscular Michael
  - Corn detective
  - Spiderweb teddy bear
  - Regular Tyrion Lannister
  - Quick Mystery Presenter
  - Mr. Sneezy
  - Two Brothers
  - Alien Mexican Armada
  - Giant Cat Monster
  - Old Women
  - Trunkphobic guy
  - Pro trunk people marriage guy
  - Muscular Mannie
  - Baby Legs Chief
  - Mrs. Sullivan's Boyfriend
  - Funny Songs Presenter
  - Tax Attorney
  - Butthole Ice Cream Guy
  - Dracula
  - When Wolf

Immortality Field Resort:
  - Arcade Alien
  - Lisa
  - Shnoopy Bloopers

Post-Apocalyptic Earth:
  - Armothy
  - Blue Footprint Guy
  - Colossus
  - Eli
  - Eli's Girlfriend
  - Genital Washer
  - Hemorrhage
  - Mohawk Guy
  - Slaveowner
  - Taint Washer

Purge Planet:
  - Arthricia
  - General Store Owner
  - Lighthouse Keeper
  - Purge Planet Ruler

Venzenulon 7:
  - Beebo

Bepis 9:
  - Bepisian

Cronenberg Earth:

Nuptia 4:
  - Beth's Mytholog
  - Boobloosian
  - Gar Gloonch
  - Gar's Mytholog
  - Glexo Slim Slom
  - Goddess Beth
  - Ideal Jerry
  - Jerry's Mytholog
  - Self-Congratulatory Jerry
  - Zarbadar Gloonch
  - Zarbadar's Mytholog

Giant's Town:
  - Dale
  - Tiny-persons advocacy group lawyer
  - Giant Judge

Bird World:

St. Gloopy Noops Hospital:
  - Dr. Glip-Glop
  - Pibbles Bodyguard
  - Shrimply Pibbles
  - Yaarb
  - Yellow Headed Doctor
  - Arbolian Mentirososian
  - St. Gloopy Noops Nurse
  - Nano Doctor
  - Traflorkian Journalist

Earth (5-126):

Mr. Goldenfold's dream:
  - Centaur
  - Creepy Little Girl
  - Melissa
  - Mrs. Pancakes
  - Scary Brandon
  - Scary Glenn
  - Scary Terry
  - Scary Teacher

Gromflom Prime:

Earth (Replacement Dimension):
  - Summer Smith
  - Beth Smith
  - Jerry Smith
  - Agency Director
  - Albert Einstein
  - Alien Googah
  - Amish Cyborg
  - Baby Wizard
  - Bearded Lady
  - Blim Blam
  - Brad
  - Brad Anderson
  - Chris
  - Coach Feratu (Balik Alistane)
  - Cousin Nicky
  - Cynthia
  - Doofus Rick
  - Dr. Wong
  - Duck With Muscles
  - Eric Stoltz Mask Morty
  - Ethan
  - Father Bob
  - Frankenstein's Monster
  - Gene
  - General Nathan
  - Ghost in a Jar
  - Gobo
  - Gordon Lunas
  - Gwendolyn
  - Hamurai
  - Invisi-trooper
  - Izzy
  - Jacqueline
  - Jaguar
  - Jamey
  - Jessica
  - Jessica's Friend
  - Jim
  - Joseph Eli Lipkip
  - Katarina
  - Keara
  - Lucy
  - Mechanical Morty
  - Mechanical Rick
  - Mechanical Summer
  - Mitch
  - Morty Jr.
  - Morty K-22
  - Morty Smith
  - Mr. Beauregard
  - Mr. Benson
  - Mr. Goldenfold
  - Mr. Marklovitz
  - Mr. Needful
  - Mr. Poopybutthole
  - Mrs. Lipkip
  - Mrs. Refrigerator
  - Nancy
  - Orthodox Jew
  - Pencilvester
  - Photography Raptor
  - Pickle Rick
  - Principal Vagina
  - Rat Boss
  - Reverse Giraffe
  - Rick K-22
  - Rick Sanchez
  - Sleepy Gary
  - Slippery Stair
  - Slow Mobius
  - Stacy
  - Steve
  - Taddy Mason
  - Terry
  - President Curtis
  - Tinkles
  - Tiny Rick
  - Toby Matthews
  - Tommy's Clone
  - Toxic Morty
  - Toxic Rick
  - Trandor
  - Tricia Lange
  - Vampire Master
  - Voltematron
  - Zick Zack
  - Uncle Steve
  - Morty Jr's interviewer
  - Guy from The Bachelor
  - Trunkphobic suspenders guy
  - Synthetic Laser Eels
  - Pripudlian
  - Michael
  - Michael's Lawyer
  - Veterinary
  - Veterinary Nurse
  - Simon
  - Vampire Master's Assistant
  - Morphizer-XE Customer Support
  - Morphizer-XE Customer Support
  - Morphizer-XE Customer Support
  - Little Voltron
  - Varrix
  - Secretary of the Interior
  - Hologram Rick
  - Bully
  - Anchorman
  - Anchorwoman
  - Morty’s Lawyer
  - Judge
  - Public Opinion Judge
  - Wasp Rick
  - Wasp Rick’s Clone
  - Boglin
  - Kirkland Brand Mr. Meeseeks
  - Danny Publitz
  - Tony's Dad
  - Jeff
  - Josiah
  - Maggie
  - Priest Witherspoon
  - Richard
  - Running Bird
  - Secretary at Tony's
  - Netflix Executive
  - Balthromaw
  - Talking Cat
  - Chachi
  - Snake Resistance Robot
  - Bar Customer
  - Bartender
  - PC Basketball Player
  - Pet Shop Employee
  - High Pilot
  - High Pilot
  - Phoenixperson
  - Defiance Beth
  - Mr. Nimbus
  - Adam
  - Mr. Nimbus Secretary
  - Mr. Nimbus' Squid
  - Scarecrow Rick
  - Scarecrow Summer
  - Scarecrow Jerry
  - Scarecrow Morty
  - Scarecrow Beth
  - Glockenspiel Jerry
  - Glockenspiel Beth
  - Glockenspiel Rick
  - Glockenspiel Summer
  - Glockenspiel Morty
  - Wicker Beth
  - Wicker Rick
  - Wicker Morty
  - Wicker Summer
  - Metal Rick
  - Gun Brain Rick
  - Mr. Always Wants to be Hunted
  - Squid Costume Beth
  - Squid Costume Jerry
  - Squid Costume Morty
  - Squid Costume Rick
  - Squid Costume Summer
  - Steve
  - Too Cute to Murder Beth
  - Too Cute to Murder Rick
  - Too Cute to Murder Jerry
  - Too Cute to Murder Morty
  - Too Cute to Murder Summer
  - Planetina
  - Diesel Weasel
  - Eddie
  - Xing Ho
  - Air Tina-Teer
  - Water Tina-Teer
  - Planetina Buyer
  - Tony Galopagus
  - Sticky
  - Professor Shabooboo
  - Sperm Queen
  - CHUD King
  - Princess Ponietta
  - Blazen
  - Kathy Ireland
  - Amazing Johnathan
  - Foal Sanchez
  - Cirque du Soleil Zumanity Member
  - Cirque du Soleil Zumanity Member
  - Cirque du Soleil Zumanity Member
  - Cirque du Soleil Zumanity Member
  - Cirque du Soleil Zumanity Member
  - Bruce Chutback
  - Space Cruiser
  - Coop
  - Dwayne
  - Franklin D. Roosevelt
  - President's General
  - Giant Assassin Hidden in the Statue of Liberty
  - Turkey Morty
  - Turkey Rick
  - Turkey President Curtis
  - Martínez
  - Marvin
  - Jackey
  - Native Alien
  - Pilgrim Alien
  - President Turkey
  - Mary-Lou
  - Big Fat rick
  - Hothead Rick
  - Ricardo Montoya
  - Wrap-it-up Little Rick
  - Yo-yo Rick
  - Voiceoverian
  - Voiceoverian
  - Gotron Pilot
  - Gotron Pilot
  - Gotron Pilot
  - Rick's Garage
  - Birdperson & Tammy's Child
  - Mr. Cookie President
  - Nick
  - Harold (Garbage Goober)
  - Harold's Wife
  - Lil B
  - Samansky
  - Super Turkey
  - Crow Horse
  - Gotron
  - Butter Robot

Exercise 6: Create a high-school yearbook style listing of images

This exercise incorporates all the skills from above, adding additional craziness to display the data in a yearbook-style layout within your quarto HTML file.

Objective: Use the “Rick and Morty” API to generate a yearbook-style grid of headshots and names of characters within this HTML.

Concepts: API data extraction, structured text generation, file I/O, basic web design.

# Retrieve all characters
# For each character print header
def retrieve_characters():
    base_url = "https://rickandmortyapi.com/api/character"
    all_characters = []
    count = 0
    while base_url:
        response = requests.get(base_url)
        if response.status_code == 200:
            characters_on_page = response.json()
            all_characters.extend(characters_on_page['results'])
            base_url = characters_on_page['info']['next']
            count = count + 1
        else:
            print(f"Error fetching data from page {page}. Status code: {response.status_code}")

    print(count)
    return all_characters

def print_formatted(character):
    return f"""
        <div class = "yearbook_picture">
            <div><img src = "{character['image']}" class = "character_image"></div>
            <div>{character['name']}</div>
        </div>
            """

if __name__ == "__main__":
    characters = retrieve_characters()
    s = ""
    for character in characters:
        s = s + print_formatted(character)

    display(HTML(s))
42
Rick Sanchez
Morty Smith
Summer Smith
Beth Smith
Jerry Smith
Abadango Cluster Princess
Abradolf Lincler
Adjudicator Rick
Agency Director
Alan Rails
Albert Einstein
Alexander
Alien Googah
Alien Morty
Alien Rick
Amish Cyborg
Annie
Antenna Morty
Antenna Rick
Ants in my Eyes Johnson
Aqua Morty
Aqua Rick
Arcade Alien
Armagheadon
Armothy
Arthricia
Artist Morty
Attila Starwar
Baby Legs
Baby Poopybutthole
Baby Wizard
Bearded Lady
Beebo
Benjamin
Bepisian
Beta-Seven
Beth Sanchez
Beth Smith
Beth Smith
Beth's Mytholog
Big Boobed Waitress
Big Head Morty
Big Morty
Body Guard Morty
Bill
Bill
Birdperson
Black Rick
Blamph
Blim Blam
Blue Diplomat
Blue Footprint Guy
Blue Shirt Morty
Bobby Moynihan
Boobloosian
Bootleg Portal Chemist Rick
Borpocian
Brad
Brad Anderson
Calypso
Campaign Manager Morty
Canklanker Thom
Centaur
Chris
Chris
Coach Feratu (Balik Alistane)
Collector
Colossus
Commander Rick
Concerto
Conroy
Cool Rick
Cop Morty
Cop Rick
Courier Flap
Cousin Nicky
Cowboy Morty
Cowboy Rick
Crab Spider
Creepy Little Girl
Crocubot
Cronenberg Rick
Cronenberg Morty
Cult Leader Morty
Cyclops Morty
Cyclops Rick
Cynthia
Cynthia
Dale
Daron Jefferson
David Letterman
Davin
Diablo Verde
Diane Sanchez
Dipper and Mabel Mortys
Tuberculosis
Gonorrhea
Hepatitis A
Hepatitis C
Bubonic Plague
E. Coli
Donna Gueterman
Doofus Rick
Doom-Nomitron
Dr. Glip-Glop
Dr. Schmidt
Dr. Wong
Dr. Xenon Bloom
Duck With Muscles
Eli
Eli's Girlfriend
Eric McMan
Eric Stoltz Mask Morty
Ethan
Ethan
Evil Beth Clone
Evil Jerry Clone
Evil Morty
Evil Rick
Evil Summer Clone
Eyehole Man
Fart
Fat Morty
Father Bob
Flansian
Fleeb
Frank Palicky
Frankenstein's Monster
Fulgora
Galactic Federation President
Gar Gloonch
Gar's Mytholog
Garblovian
Garmanarnar
Garment District Rick
Gazorpazorpfield
Gene
General Nathan
General Store Owner
Genital Washer
Ghost in a Jar
Gibble Snake
Glasses Morty
Glenn
Glenn
Glexo Slim Slom
Gobo
Goddess Beth
Gordon Lunas
Cornvelious Daniel
Gwendolyn
Hammerhead Morty
Hamster In Butt
Hamurai
Harold
Hemorrhage
Hole in the Wall Where the Men Can See it All
Hookah Alien
Hunter
Hunter's Father
Hydrogen-F
Ice-T
Ideal Jerry
Insurance Rick
Investigator Rick
Invisi-trooper
Izzy
Jackie
Jacob
Jacqueline
Jaguar
Jamey
Jan-Michael Vincent
Jerry 5-126
Jerry Smith
Celebrity Jerry
Jerry Smith
Jerry's Mytholog
Jessica
Jessica
Jessica's Friend
Jim
Johnny Depp
Jon
Joseph Eli Lipkip
Joyce Smith
Juggling Rick
Karen Entity
Katarina
Keara
Kevin
King Flippy Nips
King Jellybean
Kozbian
Kristen Stewart
Krombopulos Michael
Kyle
Lady Katana
Larva Alien
Lawyer Morty
Leonard Smith
Lighthouse Keeper
Lil B
Lisa
Little Dipper
Lizard Morty
Loggins
Logic
Long Sleeved Morty
Lucy
Ma-Sha
Magma-Q
Magnesium-J
Man Painted Silver Who Makes Robot Noises
Maximums Rickimus
MC Haps
Mechanical Morty
Mechanical Rick
Mechanical Summer
Mega Fruit Farmer Rick
Melissa
Michael Denny and the Denny Singers
Michael Jenkins
Michael McLick
Michael Thompson
Million Ants
Mitch
Mohawk Guy
Morty Mart Manager Morty
Morty Jr.
Morty Rick
Morty Smith
Morty K-22
Morty Smith
Mortytown Loco
Mr. Beauregard
Mr. Benson
Mr. Booby Buyer
Mr. Goldenfold
Mr. Goldenfold
Mr. Marklovitz
Mr. Meeseeks
Mr. Needful
Mr. Poopybutthole
Mrs. Lipkip
Mrs. Pancakes
Amy Poopybutthole
Mrs. Refrigerator
Mrs. Sanchez
Mrs. Sullivan
Nancy
Noob-Noob
Numbericon
Octopus Man
Orthodox Jew
Pat Gueterman
Paul Fleishman
Pawnshop Clerk
Pencilvester
Phillip Jacobs
Photography Cyborg
Photography Raptor
Pibbles Bodyguard
Pichael Thompson
Pickle Rick
Piece of Toast
Plumber Rick
Poncho
Presidentress of The Mega Gargantuans
Prince Nebulon
Principal Vagina
Principal Vagina
Purge Planet Ruler
Quantum Rick
Randy Dicknose
Rat Boss
Real Fake Doors Salesman
Regional Manager Rick
Regular Legs
Reverse Giraffe
Reverse Rick Outrage
Revolio Clockberg Jr.
Rick D. Sanchez III
Rick Guilt Rick
Rick Prime
Rick D-99
Rick D716
Rick D716-B
Rick D716-C
Rick Sanchez
Rick J-22
Rick K-22
Rick Sanchez
Ricktiminus Sancheziminius
Riq IV
Risotto Groupon
Risotto's Tentacled Henchman
Robot Morty
Robot Rick
Roger
Ron Benson
Ruben
Samantha
Scary Brandon
Scary Glenn
Scary Terry
Scroopy Noopers
Scropon
Scrotian
Self-Congratulatory Jerry
Shimshamian
Shlaammi
Shleemypants
Shmlamantha Shmlicelli
Shmlangela Shmlobinson-Shmlower
Shmlona Shmlobinson
Shmlonathan Shmlower
Shmlony Shmlicelli
Shmooglite Runner
Shnoopy Bloopers
Shrimply Pibbles
Simple Rick
Slaveowner
Sleepy Gary
Slick Morty
Slippery Stair
Slow Mobius
Slow Rick
Snuffles (Snowball)
Solicitor Rick
Squanchy
Stacy
Stair Goblin
Stealy
Steve
Steven Phillips
Stu
Summer Smith
Summer Smith
Supernova
Taddy Mason
Taint Washer
Tammy Guetermann
Tammy Guetermann
Teacher Rick
Terry
President Curtis
The President of the Miniverse
The Scientist Formerly Known as Rick
Thomas Lipkip
Three Unknown Things
Tinkles
Tiny Rick
Toby Matthews
Todd Crystal
Tom Randolph
Tommy's Clone
Tophat Jones
Tortured Morty
Toxic Morty
Toxic Rick
Traflorkian
Trandor
Tree Person
Tricia Lange
Trunk Morty
Trunk Man
Truth Tortoise
Tusked Assassin
Two Guys with Handlebar Mustaches
Tumblorkian
Unity
Unmuscular Michael
Vampire Master
Vance Maximus
Veronica Ann Bennet
Voltematron
Wall Crawling Rick
Wedding Bartender
Unknown Rick
Woman Rick
Worldender
Yaarb
Yellow Headed Doctor
Yellow Shirt Rick
Zarbadar Gloonch
Zarbadar's Mytholog
Zeep Xanflorp
Zeta Alpha Rick
Zick Zack
Uncle Steve
Bearded Morty
Roy
Davin
Greebybobe
Scary Teacher
Fido
Accountant dog
Tiny-persons advocacy group lawyer
Giant Judge
Morty Jr's interviewer
Guy from The Bachelor
Corn detective
Michael Jackson
Trunkphobic suspenders guy
Spiderweb teddy bear
Regular Tyrion Lannister
Quick Mystery Presenter
Mr. Sneezy
Two Brothers
Alien Mexican Armada
Giant Cat Monster
Old Women
Trunkphobic guy
Pro trunk people marriage guy
Muscular Mannie
Baby Legs Chief
Mrs. Sullivan's Boyfriend
Plutonian Hostess
Plutonian Host
Rich Plutonian
Rich Plutonian
Synthetic Laser Eels
Pizza-person
Pizza-person
Greasy Grandma
Phone-person
Phone-person
Chair-person
Chair-person
Chair-homeless
Chair-waiter
Doopidoo
Super Weird Rick
Pripudlian
Giant Testicle Monster
Michael
Michael's Lawyer
Veterinary
Veterinary Nurse
Bearded Jerry
Shaved Head Jerry
Tank Top Jerry
Pink Polo Shirt Jerry
Jerryboree Keeper
Jerryboree Receptionist
Anchor Gear
Gear Cop
Roy's Mum
Roy's Wife
Roy's Son
Simon
Vampire Master's Assistant
Arbolian Mentirososian
St. Gloopy Noops Nurse
Nano Doctor
Funny Songs Presenter
Tax Attorney
Butthole Ice Cream Guy
Traflorkian Journalist
Communication's Responsible Rick
Teleportation's Responsible Rick
SEAL Team Rick
SEAL Team Rick
SEAL Team Rick
SEAL Team Rick
Morphizer-XE Customer Support
Morphizer-XE Customer Support
Morphizer-XE Customer Support
Alien Spa Employee
Little Voltron
Baby Rick
Bartender Morty
Dancer Cowboy Morty
Dancer Morty
Flower Morty
Hairdresser Rick
Journalist Rick
Private Sector Rick
Purple Morty
Retired General Rick
Secret Service Rick
Steve Jobs Rick
Sheik Rick
Modern Rick
Tan Rick
Visor Rick
Colonial Rick
P-Coat Rick
Chang
Dr. Eleanor Arroway
Varrix
Secretary of the Interior
Crystal Poacher
Crystal Poacher
Crystal Poacher
Hologram Rick
Fascist Rick
Fascist Morty
Fascist Mr. President
Fascist Rick’s Clone
Revolio Clockberg Jr.
Fascist Shrimp Rick
Fascist Shrimp Rick’s Clone
Fascist Shrimp Morty
Fascist Shrimp SS
Fascist Teddy Bear Rick
Fascist Teddy Bear Rick’s Clone
Bully
Anchorman
Anchorwoman
Morty’s Lawyer
Judge
Public Opinion Judge
Caterpillar Mr. Goldenfold
Wasp Rick
Wasp Rick’s Clone
Wasp Morty
Wasp Summer
Wasp Jerry
Wasp Beth
Caterpillar Mr. Goldenfold’s Larvae
Boglin
Kirkland Brand Mr. Meeseeks
Glootie
Danny Publitz
Mothership Intern
Monogatron Leader
Lizard
Deliverance
Tony
Tony’s Wife
Monogatron Queen
Tony's Dad
Jeff
Josiah
Maggie
Priest Witherspoon
Richard
Running Bird
Secretary at Tony's
Mountain Sweat Jerry
Vermigurber
Miles Knightly
Heist-Con Receptionist
Angie Flint
Glar
Truckula
Snake Arms
Double Microwawe
Monitor Lord
Key Catcher
The Shapeshiftress
Heistotron
Randotron
Hephaestus
Ventriloquiver
Elon Tusk
Gramuflackian Anchorman
Gramuflackian General
Netflix Executive
Balthromaw
The Wizard
Talking Cat
Debrah
Debrah’s Partner
Michael
Slut Dragon
Shadow Jacker
Chachi
Slippy
Robot Snake
Snake Hitler
Snake Lincoln
Snake Resistance Robot
Snake Linguist
Snake Terminator
Snake Soldier
Snake with Legs
Secret Service Snake
Anchosnake
Anchosnake
80's snake
Bar Customer
Bartender
PC Basketball Player
Cavesnake
Pet Shop Employee
Snake Reporter
High Pilot
High Pilot
Phoenixperson
Tickets Please Guy
Floaty Bloody Man
Floaty Non-Gasm Brotherhood Member
Floaty Non-Gasm Brotherhood Member Friend
Abradolf Lincler
Biblesaurus
Birdperson
Cats Fan
Christmas Storyteller
Cookies Guy
Crossy
Female Scorpion
Floaty Bloody Man’s Daughter
Goomby
Hairspray Fan
Jesus Christ
Josh
Josh's Sister
Leah
Marcus
Mike Johnson
Mr. Celery & Friends
Musical Fan
Phantom of the Opera Fan
Phoenixperson
Private Smith
Professor Sanchez
Ramamama Lord
Ruth Bader Ginsburg
Sarge
Shrek The Musical Fan
Snuffles
Storylord
Tammy Guetermann
The Concept of Time
Beth Smith
Summer Smith
Morty Smith
Rick Sanchez
Train Cop
Train Cops
Train Cops Instructor
Darth Poopybutthole
Evil Morty
Morty’s Disguise
Rick’s Disguise
Uncle Nibbles
Angry Glorzo
Bruce
Council of Glorzos Member
Council of Glorzos Member
Old Glorzo
Shane
Steve
Troy
Crystal Dealers Boss
Crystal Dealer
Crystal Dealer
Crystal Dealer
SWAT Officer
Plane Crash Survivor
Plane Crash Survivor
Heroine Keith
Impervious to Acid SWAT Officer
Johnny Carson
Sonia Sotomayor
Morty’s Father-in-law
Morty’s Mother-in-law
Morty’s Girlfriend
Gaia
Reggie
Ticktock
Florflock
Squeeb
Defiance Beth
Defiance Squanchette
Defiance Doctor
New Improved Galactic Federation Guard
New Improved Galactic Federation Guard
Mr. Nimbus
Hoovy
Bova
Japheth
Japheth's Middle Son
Japheth's Eldest Son
Japheth's Youngest Son
Japheth's Grandson
Adam
Adam's Mother
Warlock
Evolved Narnian
Mr. Nimbus Secretary
Evolved Narnian Disguised as Morty
Mr. Nimbus' Squid
Scarecrow Rick
Scarecrow Summer
Scarecrow Jerry
Scarecrow Morty
Scarecrow Beth
Glockenspiel Jerry
Glockenspiel Beth
Glockenspiel Rick
Glockenspiel Summer
Glockenspiel Morty
Wicker Beth
Wicker Rick
Wicker Morty
Wicker Summer
Metal Rick
Gun Brain Rick
Mr. Always Wants to be Hunted
Squid Costume Beth
Squid Costume Jerry
Squid Costume Morty
Squid Costume Rick
Squid Costume Summer
Dracula
Steve
When Wolf
Too Cute to Murder Beth
Too Cute to Murder Rick
Too Cute to Murder Jerry
Too Cute to Murder Morty
Too Cute to Murder Summer
Planetina
Daphne
Diesel Weasel
Eddie
Xing Ho
Air Tina-Teer
Water Tina-Teer
Planetina Buyer
Tony Galopagus
Sticky
Professor Shabooboo
Sperm Queen
CHUD King
Princess Ponietta
Naruto Smith
Blazen
Kathy Ireland
Amazing Johnathan
Foal Sanchez
Spaceman
Cirque du Soleil Zumanity Member
Cirque du Soleil Zumanity Member
Cirque du Soleil Zumanity Member
Cirque du Soleil Zumanity Member
Cirque du Soleil Zumanity Member
Bruce Chutback
Alyson Hannigan
Cenobite
Cenobite
Cenobite
Cenobite
Cenobite
Coat Rack Head
Mousetrap Nipples
Changeformer
Changeformer
Space Cruiser
Coop
Dwayne
Franklin D. Roosevelt
President's General
Giant Assassin Hidden in the Statue of Liberty
Turkey Morty
Turkey Rick
Turkey President Curtis
Martínez
Marvin
Jackey
Native Alien
Pilgrim Alien
President Turkey
Mary-Lou
Big Fat rick
Hothead Rick
Ricardo Montoya
Wrap-it-up Little Rick
Yo-yo Rick
Voiceoverian
Voiceoverian
Gotron Pilot
Gotron Pilot
Gotron Pilot
Young Memory Rick
Memory Tammy
Rick's Garage
Memory Squanchy
Memory Rick
Memory Rick
Memory Geardude
Birdperson & Tammy's Child
Two Crows
Mr. Cookie President
Nick
Harold (Garbage Goober)
Harold's Wife
Alien Crow
Alien Crow
Samansky
Palicki
Sarge
Slartivartian
Ferkusian
Morglutzian
Super Turkey
7+7 Years Old Morty
26 Years Old Morty
40 Years Old Morty
Andy
Baby Mouse Skin Morty
Metaphor for Capitalism
Beth Sanchez
Crow Scare
Pussifer
Stan Lee Rick
Re-Build-a-Morty Morty
Deformed Morty
Crow Horse
Bald Rick
Punk Rick
Party Rick
Scar Rick
Long Hair Rick
Redhead Rick
Redhead Morty
Gotron
Young Jerry
Young Beth
Young Beth
Young Jerry
Butter Robot

Reflection

This assignment gave us practice with API queries and how to display the results of those queries in a nice format using python.

Adaptation and Challenges: How did you have to adapt your approach as the exercises increased in complexity, and what was the most challenging aspect of working with the “Rick and Morty” API? This question prompts students to think about their learning process, problem-solving strategies, and any difficulties they encountered with the API’s structure or data.

I was originally unfamiliar with how API’s worked in general so this did a good job at teaching how they work and how to obtain information from them. I had to consult a number of online resources on how to properly loop through the data to display it. I am also inexperienced in python so I had to learn some basic syntax for the basics.

Data Handling and Processing: In working with the data returned by the API, what considerations did you take into account for handling and presenting the data? This encourages students to reflect on the importance of data manipulation, presentation, and the user experience of their own code.

For a while I struggled with how to get the links for the images from exercise #6 to display as images so that was a bit of a headache. I managed to figure that out by importing the HTML module.

Reflection Questions on API Design: Ease of Use: Based on your experience as a consumer of the “Rick and Morty” API, what features or design elements did you find made the API particularly easy or difficult to use? This reflection can lead to discussions on good documentation, clear endpoint naming conventions, response structures, and error handling.

I’d say the Rick and Morty API was relatively easy to use, the documentation it has on how to query for various information was certainly useful. I’d say the most difficult part was figuring out how to loop through each page of the characters when obtaining all the characters for exercise #6.

API Best Practices: If you were to design your own API, what best practices would you implement based on what you’ve learned from both using the “Rick and Morty” API and from the challenges you encountered during these exercises? This encourages students to think critically about the architecture and design choices that go into creating a user-friendly and robust API.

I’d say make sure to include the information being given in the API link similar to how the Rick and Morty API does it with /character or /location in the url.

References

  1. Chatgpt was used in the creation of this assignment.
  2. Rick and Morty API
  3. Python API Tutorial
  4. How to make API calls in Python
  5. Making API calls using Python
  6. How to make an API call in Python (vscode) YOUTUBE
  7. Best practices for REST API security